﻿/**
 * 
 * @file AttributeSetDialog.h
 * @brief 批量属性设置对话框
 * @author LiBaojun (libaojunqd@foxmail.com)
 * @date 2024-12-09
 * 
 */
#ifndef _ATTRIBUTE_SET_DIALOG__H___
#define _ATTRIBUTE_SET_DIALOG__H___

#include "FITK_Kernel/FITKCore/FITKAbstractGUIDialog.h"
#include "GUIWidgetAPI.h"

namespace Ui
{
    class AttributeSetDialog;
}

namespace GUI
{
    /**
     * @brief 属性设置对话框
     * @author LiBaojun (libaojunqd@foxmail.com)
     * @date 2024-12-09
     */
    class GUIWIDGETAPI AttributeSetDialog : public Core::FITKDialog
    {
    public:
        /**
         * @brief Construct a new Attribute Set Dialog object
         * @param[i]  valueType      类型 1-double
                                     类型 2-QString
         * @param[i]  p              父对象
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-12-09
         */
        explicit AttributeSetDialog(int valueType, QWidget* p = nullptr);
        /**
         * @brief Destroy the Attribute Set Dialog object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-12-09
         */
        virtual ~AttributeSetDialog() = default;
        /**
         * @brief 设置提示信息
         * @param[i]  text           提示文本
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-12-09
         */
        void setTextLabel(const QString& text);
        /**
         * @brief 设置默认值
         * @param[i]  v              默认值
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-12-09
         */
        void setDefaultValueDouble(const double v);
        /**
         * @brief 设置默认下拉列表
         * @param[i]  list              默认值
         * @author wangning (2185896382@qq.com)
         * @date 2024-12-13
         */
        void setDefaultValueQString(const QList<QString> & list);
        /**
         * @brief 获取字符串
         * @return QString
         * @author wangning (2185896382@qq.com)
         * @date 2024-12-13
         */
        QString getValueQString();
        /**
         * @brief 获取值
         * @return double 
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-12-09
         */
        double getValueDouble();

        
    private:
        /**
         * @brief 确认 OK 按钮点击事件
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-12-09
         */ 
        void accept() override;
    

    private:
        /**
         * @brief 数值类型
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-12-09
         */
        int _valueType{ -1 };
        /**
         * @brief UI对象
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-12-09
         */
        Ui::AttributeSetDialog* _ui{};


    };
}

#endif
